local skel = fk.CreateSkill{
  name = "lb__huisheng",
  --tags = {Skill.Limited},
  max_branches_use_time = {
    ["round"] = {
      [Player.HistoryRound] = 1
    },
  }
}

Fk:loadTranslationTable{
  ["lb__huisheng"] = "回生",
  --[":lb__huisheng"] = "<b>限定技</b>，当一名角色进入濒死状态时，你可以令其将体力值调整至绝对值。",
  --9.23
  [":lb__huisheng"] = "每轮限一次，当一名角色进入濒死状态时，你可以令其将体力值调整至绝对值。",

  ["#lb__huisheng"] = "回生：你可以令 %dest 将体力回复至 %arg",

  ["$lb__huisheng1"] = "不治已病，要治未病！",
  ["$lb__huisheng2"] = "我看还能抢救一下！",
}

skel:addEffect(fk.EnterDying, {
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name) and player:usedSkillTimes(skel.name, Player.HistoryRound, "round") == 0 and target.hp < 0
  end,
  on_cost = function (self, event, target, player, data)
    return player.room:askToSkillInvoke(player, {skill_name = skel.name, prompt = "#lb__huisheng::"..target.id..":"..math.abs(target.hp),})
  end,
  on_use = function(self, event, target, player, data)
    player:addSkillBranchUseHistory(skel.name, "round")
    local room = player.room
    room:recover{
      who = target,
      num = math.abs(target.hp) * 2,
      skillName = skel.name,
      recoverBy = player
    }
  end,
})

return skel